package com.qzing.springbootmybatisdemo05.service;

import com.qzing.springbootmybatisdemo05.mapper.UserMapper;
import com.qzing.springbootmybatisdemo05.pojo.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import java.util.List;

@Service
public class UserServiceImpl implements UserService{

    @Autowired
    UserMapper userMapper;

    public List<User> queryUserList(){
        return userMapper.queryUserList();
    }

    public User queryUserById(int id){
        return userMapper.queryUserById(id);
    }

    public int addUser(User user){
        return userMapper.addUser(user);
    }

    public int updateUser(User user){
        return userMapper.updateUser(user);
    }

    public int deleteUser(int id){
        return userMapper.deleteUser(id);
    }



}
